package com.fgchen.study.user.service.impl;

import com.fgchen.study.user.domain.User;
import com.fgchen.study.user.service.LoginService;
import org.apache.thrift.TException;

/**
 * Created by fgchen on 2017/7/17.
 */
public class LoginServiceImpl implements LoginService.Iface {

    @Override
    public boolean login(User user) throws TException {
        User dbuser = new UserServiceImpl().query(user.getUsername());
        return dbuser != null
                && dbuser.getUsername() != null
                && dbuser.getPassword().equals(user.getPassword());
    }
}
